<template>
<view class="a">
    <media-home class="aa" v-show="cur==0"></media-home>
    <me class="aa" v-show="cur==1"></me>
    <view class="bu"></view>
    <view class="footer row">
        <view v-for="(item,index) in tabBar.list" :key="index" @click="go(item.pagePath,index)">
            <image class="icon" :src="cur==index?item.selectedIconPath:item.iconPath" mode="" />
            <view class="text" :class="cur==index?'cur':''">{{item.text}}</view>
        </view>
	</view>
</view>

</template>
<script>
	export default {
		data() {
			return {
                cur:0,
				tabBar: {
                    color: "#999999",
                    selectedColor: "#ff4a4a",
                    list: [
                        {
                            pagePath: "pages/index/index",
                            text: "首页",
                            iconPath: "/static/icon/04.png",
                            selectedIconPath: "/static/icon/05.png"
                        },
                        {
                            pagePath: "pages/me/index",
                            text: "我的",
                            iconPath: "/static/icon/08.png",
                            selectedIconPath: "/static/icon/09.png"
                        }
                    ]
                },
			};
		},
       
        created(){
            uni.navigateTo({
				//  url: "/pages/house_info/house_info"
				//  url: "/admin/house/tag"
				//  url: "/admin/house/house"
				//  url: "/tools/about/index"
				//  url: "/tools/map/map"
                //  url: "/tools/login/login"
                // url: "/admin/house/house_list"
			})
        },
		methods: {
			go(url,index){
               let is_avatar=uni.getStorageSync('user_info').avatarUrl
                if (index==1&&!is_avatar) {
                    uni.navigateTo({
                        url: '/tools/login/login'
                    });
                }else{
                    this.cur=index
                }
                
            },
            gos(){
                console.log(12211212121221312312);
            }
		}
	}
</script>

<style lang="scss">
    .bu{
        height: 100rpx;
    }
    .footer{
        width: 100%;
        height: 100rpx;
        position: fixed;
        bottom: 0rpx;
        background: #fff;
        // justify-content: space-evenly;
        box-shadow: 0rpx 0rpx 10rpx 10rpx #e1e1e1;
       justify-content: space-around;
        .icon{
            width: 50rpx;
            height: 50rpx;
        }
        .cur{
            color: $col;
        }
    }
</style>